package com.scau.vo;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * StoreInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "store_info", catalog = "db_hairdressingpos")
public class StoreInfo implements java.io.Serializable {

	// Fields

	private Integer id;
	private Timestamp gmtCreate;
	private Timestamp gmtModified;
	private String name;
	private String address;
	private String phone;
	private String storeInfo;
	private Set<Admin> admins = new HashSet<Admin>(0);
	private Set<Vip> vips = new HashSet<Vip>(0);

	// Constructors

	/** default constructor */
	public StoreInfo() {
	}

	/** minimal constructor */
	public StoreInfo(Timestamp gmtCreate) {
		this.gmtCreate = gmtCreate;
	}

	/** full constructor */
	public StoreInfo(Timestamp gmtCreate, Timestamp gmtModified, String name,
			String address, String phone, String storeInfo, Set<Admin> admins,
			Set<Vip> vips) {
		this.gmtCreate = gmtCreate;
		this.gmtModified = gmtModified;
		this.name = name;
		this.address = address;
		this.phone = phone;
		this.storeInfo = storeInfo;
		this.admins = admins;
		this.vips = vips;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "gmt_create", nullable = false, length = 19)
	public Timestamp getGmtCreate() {
		return this.gmtCreate;
	}

	public void setGmtCreate(Timestamp gmtCreate) {
		this.gmtCreate = gmtCreate;
	}

	@Column(name = "gmt_modified", length = 19)
	public Timestamp getGmtModified() {
		return this.gmtModified;
	}

	public void setGmtModified(Timestamp gmtModified) {
		this.gmtModified = gmtModified;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "address")
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "phone")
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "storeInfo")
	public String getStoreInfo() {
		return this.storeInfo;
	}

	public void setStoreInfo(String storeInfo) {
		this.storeInfo = storeInfo;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "storeInfo")
	public Set<Admin> getAdmins() {
		return this.admins;
	}

	public void setAdmins(Set<Admin> admins) {
		this.admins = admins;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "storeInfo")
	public Set<Vip> getVips() {
		return this.vips;
	}

	public void setVips(Set<Vip> vips) {
		this.vips = vips;
	}
	
	@Override
	public String toString() {
		return "{\"id\":" + id 
				+ ", \"gmtCreate\":" + "\"" +gmtCreate + "\""
				+ ", \"gmtModified\":" + "\"" +gmtModified+ "\""
				+ ", \"name\":" + "\"" +name + "\""
				+ ", \"address\":" + "\"" +address + "\"" 
				+ ", \"phone\":" + "\"" +phone + "\""
				+ ", \"storeInfo\":" + "\"" +storeInfo + "\"" 
				+ ", \"admins\":" + admins
				+ ", \"vips\":" + vips
				+ "}";
		
	}

}